<?php
$this->breadcrumbs=array(
        'Administrar',
	'Usuários',
);

$this->menu=array(
	array('label'=>'Novo Usuário', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('usuario-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Administrar Usuários</h1>

<div class="search-form">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'usuario-grid',
	'dataProvider'=>$model->search(),
        'template'=>'{items}',
	'columns'=>array(
                array(
                    'name'=>'id_usuario',
                    'value'=>'$data->id_usuario',
                    'headerHtmlOptions'=>array('style'=>'width: 50px; height: 30px;'),
                    'htmlOptions'=>array('style'=>'text-align: center; height: 20px;'),
                ),
                array(
                    'name'=>'nome',
                    'value'=>'$data->nome',
                    'headerHtmlOptions'=>array('style'=>'width: 300px; height: 30px;'),
                    'htmlOptions'=>array('style'=>'text-align: left; height: 20px;'),
                ),
                array(
                    'name'=>'email',
                    'value'=>'$data->email',
                    'headerHtmlOptions'=>array('style'=>'width: 300px; height: 30px;'),
                    'htmlOptions'=>array('style'=>'text-align: left; height: 20px;'),
                ),
		array(
			'class'=>'CButtonColumn',
                        'template'=>'{delete}{update}'
		),
	),
)); ?>
